package com.example.java_chatroom.service;

import com.example.java_chatroom.mapper.FriendApplyMapper;
import com.example.java_chatroom.model.FriendApply;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FriendApplyService {
    @Autowired
    private FriendApplyMapper friendApplyMapper;

    public Integer insertFriendApply(String friend, String argument, String user) {
      return  friendApplyMapper.insertFriendApply(friend, argument, user);
    }

    public List<FriendApply> queryFriendName(String userName) {
        return friendApplyMapper.queryFriendName(userName);
    }

    public void deleteMessage(String user) {
        friendApplyMapper.deleteMessage(user);
    }

    public Integer updateFriendApply(String argument, String friend, String userName) {
        return friendApplyMapper.updateFriendApply(argument, friend, userName);
    }

    public List<FriendApply> queryFriendNameByUserName(String userName) {
        return friendApplyMapper.queryFriendNameByUserName(userName);
    }
}
